package top.yxqz.vagrancy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * @author: 余小小
 * @date: 2023/5/30
 * @description：管理员面板表述层
 */
@Controller
public class AdminController {

    @GetMapping
    public String goLogin() {
        return "page-login";
    }

    /**
     * uri:/admin
     */
    @GetMapping("admin")
    public String goIndex() {
        return "index";
    }

    /**
     * 系统退出
     * @return
     */
    @GetMapping("admin/logout")
    public String doLogOut(HttpSession session) {
        session.invalidate();
        return "redirect:/";
    }
}
